Repository navigation
fix(metadata-protocol): a code package's placed tab or added field is saved in its source text from a translated read - #36813
Conversation
… over an older stored row is saved as its source The save door's translated-echo restore now takes the packaged owner beside the packaged base, so what the base carries beyond the owner (a field a code extender adds, a relatedLists entry its place splices in) is the last source for a field or entry the stored row does not declare at all. The TranslateDocumentOptions.packagedBase docblock names the placed entries and where a placement is judged. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufziH9MVhWYLVCiw5eXB
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufziH9MVhWYLVCiw5eXB
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufziH9MVhWYLVCiw5eXB
📓 Docs Drift Check10 anchor(s) derived from 2 changed package(s); no hand-written page names any of them, so this run has nothing to list — not a clean bill of health. This check sees only pages that NAME a derived anchor: one that documents this change in prose, or enumerates it in an authoring dialect, names none and stays invisible to it on every run. What this run could not see
Coarse fallback — 176 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin ff3d5ce74645f6c59abf7a09935788ebebd3f896 && git checkout ff3d5ce74645f6c59abf7a09935788ebebd3f896
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 65ee4b7ad49361bc3cfaf3a32c9ed02752d4a152 15e41882289f6745017657fda3e975fccecf8e13 && git checkout -B drift-repro 65ee4b7ad49361bc3cfaf3a32c9ed02752d4a152 && git merge --no-ff 15e41882289f6745017657fda3e975fccecf8e13
node scripts/docs-audit/affected-docs.mjs --json 65ee4b7ad49361bc3cfaf3a32c9ed02752d4a152 |
|
repo:objectstack#3 · os-support-ai · session_01WGufziwMkZG34d69p8BHb4 Contract-review-claim: session_01WGufziwMkZG34d69p8BHb4 · head 15e4188 · 2026-11-24T02:22Z Face: published schema ( |
|
repo:objectstack#3 · os-support-ai · session_01WGufziwMkZG34d69p8BHb4 Contract reviewServed-tier: Read for this record: card #36595 (body and its three comments: triage 7089293793, claim 7118543153, dev report 7119401800), PR #36813 (body, both comments, the five-file net diff against ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgment
No must-fix, no should-fix.
Implemented-by: VERDICT: PASS |
|
repo:objectstack#3 · os-support-ai · session_01WGufziwMkZG34d69p8BHb4 席位核对 — ACCEPT · repo:objectstack#3 · head 15e4188 · 2026-11-24T02:29ZL1: ACCEPT Checklist
FindingsMust-fix: none. Should-fix: none. The contract review's N1 ("declares Before landing (paper, seat; not a finding on this diff)The contract review's ③ found two seat routes the PR body relies on that are not on GitHub. Card #36595 carries only triage, the claim and the dev report.
Post both on #36595 before or with the partial Landing notes
|
|
repo:objectstack#3 · os-support-ai · session_01WGufziH9MVhWYLVCiw5eXB Landing · 2026-11-24T02:31Z · ACCEPT 7120201019 (L1-b) at head 15e4188
State: ready + auto-merge (area ux-D, not governed, ≤3000 lines). |
Requested by Yibo Wang · project thread
Refs #36595 (items 1, 2, 3; item 4 is left out and reported to the seat as a fork)
Clause-②: no
Metadata-protocol: none
repo:objectstack#3 · os-support-ai · session_01WGufziH9MVhWYLVCiw5eXB
维护者速读
What changes
Item 1 (save door, main item).
restoreTranslatedEchoestakes a new optionalpackagedOwnerbesidepackagedBase. With it, what the packaged base carries beyond the owner (a field a code extender adds under a name the owner does not declare, and arelatedListsentry whoselistthe owner does not name, i.e. one a code extender'splacesplices in) is the LAST source, used only for an incoming field or entry the stored row does not declare at all. The save door (ProtocolDiscoveryAndBasesFacet.restoreTranslatedObjectEchoes) reads the owner from the engine's registry (getPackagedObjectOwner, the readgetPackagedObjectBasealready falls back to) and hands it in. Landing point:protocol-translated-echo.ts, as the dispatch expected, plus the one hand-over line inprotocol-discovery-and-bases.ts. The objectql packaged-base producer is unchanged: it already carries the placed entries and added fields (#36574's route (a)); what was missing was a source on the save side.What does not change, by construction:
packagedBasedocblock onrestoreTranslatedEchoesdescribes).overlay ?? own), so a body carrying it again keeps its text.protocol-save.ts,source: item) and the pure injected-column half (source: undefined) pass no owner and behave as before.Reachability (measured on origin/main 844218f, by reading). No in-repo editor reaches the edge:
ui/packages/data-objectstack/src/authored-layers.ts,authoredBuffer: thedraftlayer, else an object'soverlay ?? code), never the translated served read;ResourceEditPage.tsxuses it for every translatable type.recordTabsConfigSave.ts, "composed over what is STORED, never what is served").?state=draftread is translated but not folded (protocol-meta-item-reads.ts, the A tenant object overlay drops everyobjectExtensionsfield from the resolved schema, andeffectivecontradictscodein the same response #8027 note: the fold runs after the draft return), so it never carries a placed entry.GET /meta/object/NAMEread IS folded and translated (translateMetaDocumentinpackages/rest/src/meta-item-read-gate.ts), andPUT /meta/object/NAMErunsrestoreTranslatedObjectEchoeswith the stored row as source. So the edge is reachable by any API client that saves the read it got back; the fix applies as defence for that door. Not reproduced over HTTP in this PR.Item 2 (N4): documented deviation, no fix — a seat-accepted deviation (repo:objectstack#3, 2026-11-24T01:45Z). The base judges "declares
relatedLists" on the owner; the fold judges it on its base layer (overlay ?? own). Making the base follow a tenant overlay would make the PACKAGED base read a tenant row (the docblock defines it as the code layer, before any overlay) and would change which text a reader sees in a case the card does not settle (a catalog translation instead of the authored placement label), which the dispatch routes to a fork. The deviation is now stated in theTranslateDocumentOptions.packagedBasedocblock: where only a tenant overlay declaresrelatedLists, the placed tab has no packaged counterpart, reads as authored, and the deployment catalog does not translate it. No wrong text is served (the label shown is the extender's own source).Item 3 (N5): docblock only.
TranslateDocumentOptions.packagedBase(packages/spec/src/system/i18n-resolver.ts) now names the placedrelatedListsentries besidevalidationsand addedfields.Item 4 (lint union): left out, reported as a fork. Measured with a throwaway probe (deleted): an owner-labelled
_relatedLists.contactkey resolves with 0 findings when a.customarrangement hides the entry ({ list: 'contact', hidden: true }) or names it bare (['case', 'contact']); the control (owner entry unlabelled, arrangement hides it) gives 1translation-target-unknownfinding at severityerror. Tightening the rule would therefore turn an accepted key into anos validateerror, a(narrowing)arm, so it is not in this PR.No ruling governs the edited lines: the
ruling/maintainer/⛔lines near each edit were read; the only one nearby (protocol-translated-echo.ts, the patch-entry rule "asked throughpackagedOwner... byscalarOverridesPackagedBase, ⛔ never a second copy") is about patch entries and is untouched; the new source asks no override question. Decisions cited: ADR-0029 D9.2 / D9.2a.Tests
protocol-translated-echo.test.ts, describe "a code extender's placed title or added field, over a stored row that predates it": the pure restore, the tenant-rename and owner-dropped controls, and the door test "the save door hands the restore the packaged owner: a non-source-locale save over the stored row lacking the entry keeps the source title" (the card's re-check criterion).packagedBasedocblock.Acceptance notes
restoreTranslatedEchoes' local callback parameter insourceOfis also spelledpackagedOwner(pre-existing, a different thing: the packaged slot owner for a patch entry). The new argument is always read asargs.packagedOwner; no shadowing, but the names read alike.validate-translation-references.tssays "where the target declares" (the looser spelling the review's N4 noted); left as is, outside this PR's items.Verification
Two-minute check:
pnpm --filter @objectstack/metadata-protocol exec vitest run --maxWorkers=2 src/protocol-translated-echo.test.tsshows 19 passed, including the five cases of the new describe.Read first:
packages/metadata-protocol/src/protocol-translated-echo.ts(theextenderDoccut: the stored-row and owner exclusions are the risk), thenprotocol-discovery-and-bases.ts(the owner read), then the docblock ini18n-resolver.ts.Local runs (head 15e4188)
vitest run src/protocol-translated-echo.test.ts src/protocol-translated-echo.related-lists-36528.test.ts: Test Files 2 passed, Tests 22 passed.@objectstack/metadata-protocolsuite under the lock: Test Files 365 passed, 9 skipped (374); Tests 23359 passed, 45 skipped; VERDICT command-exit 0.@objectstack/metadata-protocoltypecheck: exit 0 (--listFilesincludes the test file).@objectstack/objectqldoor files (protocol-meta-effective-schema.test.ts,registry-related-lists-label-translation-36528.test.ts) against the rebuilt closure: 28 passed.pnpm --filter @objectstack/spec build && pnpm --filter @objectstack/spec check:generated: all 14 generated artifacts up to date.Ablation (committed fix, restored to HEAD by blob)
['extender', extenderDoc]source (node scripts/ablation-replace.mjs, anchor 1 to 0, blob 120e8d8e to 6ca9d157): 3 failed / 16 passed: the pure restore, the owner-dropped case's extender half, and the door test. Restored: blob == HEAD (120e8d8e),git diff HEADempty.packagedOwnerhand-over inprotocol-discovery-and-bases.ts(anchor 1 to 0): 1 failed (the door test) / 18 passed. Restored: blob == HEAD,git diff HEADempty.Derived gate families
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackderived 90 commands; all 90 run locally,--ranreconciliation: 90 derived, 90 run, 0 UNRUN.check:cross-package-test-inputs,check:tier-file-adoption,check:nul-bytes,check:undeclared-dep-imports,check:test-source-alias,check:issue-citations,check-closing-keyword-parity) re-run at 15e4188: all exit 0.check:test-source-aliaswas red at 13ff81c (the new door test reached@objectstack/lintthrough dynamic imports inside a clock); fixed by the module-top import it prescribes, green at 15e4188.check-plugin-teardown-shape --self-test(exit 3: shallow clone cannot reach its pinned fixture commit);check:dts-closure(exit 1),check:dual-build-cjs-loads(exit 3, PREREQUISITE NOT MET) andcheck:lean-entry-closure(exit 3): each reads the whole tree's builtdist/, which this worktree does not hold. CI's.test:repo(the vitestrepoproject), Test Core shards, Build Core, type-check lanes and the dogfood battery: CI's.🤖 Generated with Claude Code
https://claude.ai/code/session_01WGufziH9MVhWYLVCiw5eXB
Generated by Claude Code